import {
	BASE_URL
} from '@/env'
export const myRequest = (options) => {

	return new Promise((resolve, reject) => {
		let authtoken = uni.getStorageSync('authtoken')
		uni.request({
			url: BASE_URL + options.url,
			data: options.data || {},
			method: options.method || 'GET',
			header: {
				'Content-type': 'application/json',
				'token': uni.getStorageSync('token') //这里的token指的是微信授权登录的token，用来判断小程序是否属于登录状态
			},
			dataType: 'json',
			success: res => {
				if (res.data.code !== 0) {}
				resolve(res)
			},
			fail: err => {
				reject(err)
			}
		})
	})
}
